package mx.netbrain.model;

// Generated Sep 26, 2012 10:26:19 PM by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Profile generated by hbm2java
 */
@Entity
@Table(name = "profile", catalog = "netbrain", uniqueConstraints = @UniqueConstraint(columnNames = "profile"))
public class Profile implements java.io.Serializable {

	private Long id;
	private String profile;
	private Set<User> users = new HashSet<User>(0);

	public Profile() {
	}

	public Profile(String profile) {
		this.profile = profile;
	}

	public Profile(String profile, Set<User> users) {
		this.profile = profile;
		this.users = users;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "profile", unique = true, nullable = false, length = 20)
	public String getProfile() {
		return this.profile;
	}

	public void setProfile(String profile) {
		this.profile = profile;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "profile")
	public Set<User> getUsers() {
		return this.users;
	}

	public void setUsers(Set<User> users) {
		this.users = users;
	}

}
